<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Title</title>
    
    <style>
      .card {
        border: 1px gray solid;
        border-radius: 10px;
        padding: 15px;
      }
      
      .card-title {
        font-size: 15px;
        font-weight: bold;
        margin: 10px 10px 10px 0px;
      }
      
      .card-body {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
      }
      
      .card-body > div {
        color: darkgray;
        background: pink;
        padding: 20px;
      }
      
      .aspect-ratio > div {
        aspect-ratio: 1/1;
      }
      
      /* 不支持aspect-ratio: 1/1属性时使用新CSS */
      @supports not(aspect-ratio: 1/1) {
        .aspect-ratio > div {
          height: 200px;
        }
      }
    </style>
  </head>
  <body>
    <div class="card">
      <div class="card-title">网格布局弊端</div>
      <div class="card-body">
        <div>1</div>
        <div>2</div>
        <div>同一行的盒模型高度相同同一行的盒模型高度相同同一行的盒模型高度相同同一行的盒模型高度相同</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
        <div>7</div>
        <div>8</div>
        <div>9</div>
      </div>
    </div>
    <br>
    <div class="card">
      <div class="card-title">aspect-ratio</div>
      <div class="card-body aspect-ratio">
        <div>1</div>
        <div>2</div>
        <div>同一行的盒模型高度相同同一行的盒模型高度相同同一行的盒模型高度相同同一行的盒模型高度相同</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
        <div>7</div>
        <div>8</div>
        <div>9</div>
      </div>
    </div>
  </body>
</html>